package dk.au.cs.bdsi;

import java.io.IOException;
import java.util.HashMap;

import com.sun.grizzly.http.SelectorThread;
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory;

/**
 * Simple server, deploying Jersey services via the Grizzly Web container.
 * 
 * @author Michael Dahl (micdah@cs.au.dk)
 * @version 2010-12-07 Initial implementation
 * @since 0.0.1
 *
 */
public class SimpleServer {
	public static void main(String[] args) throws IllegalArgumentException, IOException {
		final String baseUri = "http://localhost:9998/";
		HashMap<String, String> initParams = new HashMap<String, String>();
		initParams.put("com.sun.jersey.config.property.packages", "dk.au.cs.bdsi");
		System.out.println("Starting grizzly...");
		SelectorThread selectorThread = GrizzlyWebContainerFactory.create(baseUri, initParams);
		System.out.println("Running...");
		System.in.read();
		selectorThread.stopEndpoint();
		System.exit(0);
	}
}
